#!/usr/bin/env bash
# encoding: utf-8.0

function joinByChar() {
  local IFS="$1"
  shift
  echo "$*"
}

function test_split_func()
{
  local params="$1"
  IFS=:
  to_array=()
  i=0
  for dir in $params
  do
    to_array[$i]=${dir}
    i+=1
  done

  to_array[$i]=${ld_postgres}

  echo ${to_array[*]}
}

#test_split_func $LD_LIBRARY_PATH

result=($(test_split_func $LD_LIBRARY_PATH))

#echo "func return: ${result[*]}"
echo "func return: ${result[0]}"
echo "func return: ${result[1]}"

#RE_LD=$(joinByChar ':' ${result[@]})

#echo "funcTreturn: ${RE_LD}"


